package org.example.admin.service.impl;

import org.example.admin.mapper.ItemMapper;
import org.example.admin.service.ItemService;
import org.example.entity.Item;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Transactional
@Service
public class ItemServiceImpl implements ItemService   {

    private ItemMapper itemMapper;

    public ItemServiceImpl(ItemMapper itemMapper) {
        this.itemMapper = itemMapper;
    }

    //添加商品种类
    @Override
    public int insertIntem(Item item) {
       return itemMapper.insert(item);
    }
    //分页查询item
    @Override
    public List<Item> getItemAll(Integer offset, Integer limit) {
        return itemMapper.getItemAll(offset,limit);
    }



}
